package com.dxf.sysadmin.controller;

import com.dxf.common.utils.ResultJson;
import com.dxf.sysadmin.entity.qo.ClazzQo;
import com.dxf.sysadmin.entity.qo.MyPage;
import com.dxf.sysadmin.service.EvaluteResultService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/admin/result")
@Api(tags  = "EvaluteResultController|评价结果控制器")
public class EvaluteResultController {
    @Autowired
    private EvaluteResultService evaluteResultService;


    /**
     * @Description: 评价结果列表分页查询
     */
    @PostMapping("resultPage")
    @ApiOperation("评价结果列表分页查询")
    public ResultJson resultPage(@RequestBody MyPage qry){
        //TODO 未完善sql语句，不一定使用
        return evaluteResultService.resultPage(qry);
    }

    /**
     * @Description: 系主任评价结果数据查询
     */
    @GetMapping("department/{uid}/{tid}")
    @ApiOperation("系主任评价结果数据查询")
    public ResultJson departmentResult(@PathVariable Long uid,@PathVariable Long tid){
        return evaluteResultService.departmentResult(uid,tid);
    }

    /**
     * @Description: 室主任评价结果数据查询
     */
    @GetMapping("director/{uid}/{tid}")
    @ApiOperation("室主任评价结果数据查询")
    public ResultJson directorResult(@PathVariable Long uid,@PathVariable Long tid){
        return evaluteResultService.directorResult(uid,tid);
    }

    /**
     * @Description: 评教汇总excel数据
     */
    @GetMapping("getResult/{tid}")
    @ApiOperation("评教汇总excel数据")
    public ResultJson getExcelResult(@PathVariable Long tid){
        return evaluteResultService.getExcelResult(tid);
    }
}
